<!-- 分类展示：first-one 风格  -->
<template>
  <view class="ss-flex-col">
    <view class="goods-box" v-for="item in pagination.list" :key="item.id">
      <s-goods-column
        size="sl"
        :data="item"
        @click="sheep.$router.go('/pages/goods/index', { id: item.id })"
      >
	 <template v-slot:cart>
	    <!-- <button class="ss-reset-button cart-btn" /> -->
	 			 <button class="ss-reset-button cart-btn carbutton"  @click.stop="onclickcart(item.skuIds[0])">
	 			    加入购物车
	 			  </button>
	  </template>
	    </s-goods-column>
    </view>
  </view>
</template>

<script setup>
  import sheep from '@/sheep';
  import $store from '@/sheep/store';
  import { showAuthModal, showShareModal } from '@/sheep/hooks/useModal';

  const props = defineProps({
    pagination: Object,
  });
  
  function onclickcart (e){
  	 
  	  // state.showSelect =  true;
  	  
  	 //   console.log(e)
  	 //   console.log("3339999")
  	 
  	 // return
  	 
  	 
  	 // if (!$store('user').isLogin) {
  	 // 	  console.log("denglMode")
  	 //   showAuthModal();
  	 //   return;
  	 // }
   	  
  	  // if (!e.id) {
  	  //   sheep.$helper.toast('请选择商品规格');
  	  //   return;
  	  // }
  	   // console.log()  goods_num: state.selectedSku.goods_num,
  	  var ge = {
  		  
  		  goods_num: 1,
  		  id: e,	  
  		  
  	  }
  	  
  	  sheep.$store('cart').add(ge);
   	  console.log("ddfefwefwf");
   };
</script>

<style lang="scss" scoped>
  .goods-box {
	margin-top:30rpx;
    width: 100%;
  }
  
  .carbutton{
  	  
  	  
  	    
  		color: white;
  	  
  	     background: linear-gradient(to right,#FF6000 ,#FE832A );
  	  
  }
</style>
